﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using IM.Interfaces;

namespace IM.GUI.Widgets.Settings
{
    public partial class SettingsWindow : Form
    {
        private static SettingsWindow instance = null;
        private static ICore core = null;

        private SettingsWindow()
        {
            InitializeComponent();

            this.AcceptButton = this.settings1.SaveButton;
            this.CancelButton = this.settings1.CancelButton;
        }

        public static SettingsWindow GetInstance(ICore core)
        {
            SettingsWindow.core = core;

            var ins = GetInstance();

            ins.settings1.LoadProtocolControls(core);

            return ins;
        }

        public static SettingsWindow GetInstance()
        {
            if (instance == null)
                instance = new SettingsWindow();

            return instance;
        }
    }
}
